import {
  uniqueId
} from 'lodash'

import {
  mapState
} from 'vuex';

function supplementPath(menu) {
  return menu.map(e => ({
    ...e,
    path: e.path || uniqueId('d2-menu-empty-'),
    ...e.children ? {
      children: supplementPath(e.children)
    } : {}
  }))
}

export const menuHeader = supplementPath([
  // {
  //   path: '/customer/servicemsg',
  //   title: '客服',
  //   icon: 'shopping-basket',
  // },
  {
      path: '/netdisk/storeNetdisk',
      title: '网盘空间',
      icon: 'folder-o',
    },

])

export const menuAside = supplementPath([{
    path: '/index',
    title: '首页',
    icon: 'home'
  },
  {
    title: '产品管理',
    icon: 'shopping-bag',
    children: [{
        path: '/product',
        title: '产品类表',
        icon: 'shopping-basket',
      },
      {
        path: 'productCategory',
        title: '分类管理',
        icon: 'bars'
      }
    ]
  },
  {
    title: '促销管理',
    icon: 'shopping-bag',
    children: [{
      path: '/promotion/coupon',
      title: '优惠券',
      icon: 'shopping-basket',
    }]
  },
  {
    title: '订单管理',
    icon: 'shopping-bag',
    children: [{
      path: '/order/productOrder',
      title: '产品订单',
      icon: 'shopping-basket',
    }]
  },
  {
    title: '站点设置',
    icon: 'folder-o',
    children: [{
      path: '/settings',
      title: '站点设置'
    }]
  }
])
